f1 = open("E:/测试2.txt", "r", encoding="UTF-8")
f2 = open("E:/测试3.txt", "w", encoding="UTF-8")
for x in f1:
    x = x.strip()
    if x.split(",")[-1] == "正式":
       f2.write(x)
       f2.write("\n")
    else:
        continue
try:
    f = open("E:/测试4.txt", "r", encoding="UTF-8")
except:
    f = open("E:/测试4.txt", "w", encoding="UTF-8")